import { defineStore } from 'pinia'
import { ref } from 'vue'

const initState = { deviceType: '', height: '' }

export const useSysInfoStore = defineStore(
  'sysInfo',
  () => {
    const sysInfo = ref({ ...initState })

    const setSysInfo = (val) => {
      sysInfo.value = val
    }

    const clearSysInfo = () => {
      sysInfo.value = { ...initState }
    }

    return {
      sysInfo,
      setSysInfo,
      clearSysInfo,
    }
  },
  {
    persist: true,
  },
)
